package com.platform.enums.converters;

import com.platform.enums.FunctionType;

import javax.persistence.AttributeConverter;

/**
 * Description: 菜单类型枚举转换-JPA
 *
 * @author libin Created on 2019/7/24
 **/
public class FunctionTypeConverter implements AttributeConverter<FunctionType, String> {
    @Override
    public String convertToDatabaseColumn(FunctionType attribute) {
        return attribute.getValue();
    }

    @Override
    public FunctionType convertToEntityAttribute(String dbData) {
        return FunctionType.getByValue(dbData);
    }
}
